<template>
  <div class="btnGroup-container">
    <span class="column-btn edit-btn" v-if="edit" @click="editClick">编辑</span>
    <span
      class="column-btn delete-btn"
      :class="{ 'margin-left': edit }"
      v-if="del"
      @click="deleteClick"
      >删除</span
    >
  </div>
</template>

<script>
export default {
  name: "btnGroup",
  props: {
    row: {
      type: Object,
    },
    edit: {
      // 修改
      type: Boolean,
      default: true,
    },
    del: {
      // 删除
      type: Boolean,
      default: true,
    },
  },
  data() {
    return {};
  },
  methods: {
    // 修改
    editClick() {
      this.$emit("editTableClick", this.row);
    },
    // 删除
    deleteClick() {
      this.$emit("deleteTableClick", this.row);
    },
  },
  created() {},
};
</script>

<style scoped>
.margin-left {
  margin-left: 15px;
}
.column-btn {
  font-size: 14px;
  cursor: pointer;
}
.edit-btn {
  color: #39a0ff;
}
.delete-btn {
  color: #ff4444;
}
</style>

